package com.wf.pattern.observer.demo;

import lombok.Getter;
import lombok.Setter;

import java.util.EventObject;

/**
 * 事件类，用于封装事件源及一些与事件相关的参数
 *
 * @since 2021/10/30
 */
@Setter
@Getter
public class RingEvent extends EventObject {

    private static final long serialVersionUID = 4854036620043267270L;

    private boolean sound;

    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public RingEvent(Object source, boolean sound) {
        super(source);
        this.sound = sound;
    }
}
